<template>
  <div class="life-box">
    <h2>生命周期</h2>
    <button @click="num++">{{num}}</button>
  </div>
</template>

<script>
  export default {
    data(){
      return {
        num:100
      }
    },
    beforeCreate(){
      console.log('beforeCreate');
    },
    async created(){
      await new Promise(resolve =>{
        setTimeout(()=>{
          resolve
        },10000)
      })
      console.log('created');
    },
    beforeMount(){
      console.log('beforeMount');
    },
    mounted(){
      console.log('mounted');
    },
    beforeUpdate(){
      console.log('beforeUpdate');
    },
    updated(){
      console.log('updated');
    },
    beforeDestroy(){
      console.log('beforeDestroy');
    },
    destroyed(){
      console.log('destroyed');
    }
  }
</script>

<style lang="sass" scoped>

</style>
